package com.nowcoder.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nowcoder.community.entity.Message;

import java.util.List;

/**
 * @program: community
 * @description:
 * @author: hmx
 * @create: 2021-12-19 22:28
 **/
public interface MessageMapper extends BaseMapper<Message> {

    // 查询当前用户的会话列表,针对每个会话只返回一条最新的私信.
    List<Message> selectConversations(int userId, int offset, int limit);

    // 查询当前用户的会话数量.
    int selectConversationCount(int userId);

    // 查询某个主题下最新的通知
    Message selectLatestNotice(int userId, String topic);
}
